﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BreakerControlSoft
{
    public partial class FrmInput : Form
    {
        //private string Title;
        public string strInput;
        public FrmInput(string title)
        {
            this.Text = title;
            InitializeComponent();
        }

        private void FrmInput_Load(object sender, EventArgs e)
        {
            btnOK.Focus();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            strInput = txtInput.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void txtInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                btnOK_Click(null, null);
            }
        }
    }
}
